<?php
/**
 * Created by PhpStorm.
 * User: De Niro
 * Date: 2015/5/22
 * Time: 15:02
 */
require_once("../api.php");
if($_SERVER['REQUEST_METHOD'] != 'POST') {
    ajaxJSON(false,'method_error');
}else{
    $db = new SQLite3('../chatroom.db');//连接数据库
    $user_id = $_POST['user_id'];
    $sql = "select * from user_info where user_id = $user_id";
    $result = $db ->query($sql);
//    $resultArr = array();
    if( $row = $result -> fetchArray(SQLITE3_ASSOC) ) {
        ajaxJSON( true, "success" ,$row);
    }else{
        ajaxJSON( true, "emptyInfo" ,$sql);
    }
}